package com.bdqn.mapper;

import com.bdqn.entity.TSupplier;
import com.bdqn.entity.TSysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    /**
     * 统计用户数量的方法
     * @return
     */
    int count();

    /**
     * 查询全部信息
     * @return
     */
    List<TSysUser>getUserList();

    /**
     *更具姓名模糊查询
     * @param realName
     * @return
     */
    List<TSysUser>getUsersByRealName(String realName);

    /**
     * 查询用户列表
     * @param sysUser
     * @return
     */
    public List<TSysUser>getUserListByPojo(TSysUser sysUser);

    public List<TSysUser>getUserListByMap(Map<String,Object> userMap);

    public List<TSysUser>getUserListByParams(@Param("realName")String realName,
                                             @Param("roleId")int roleId);

    public List<TSysUser>getUserListWithRoleName(SysUserMapper sysUserMapper);

    public List<TSysUser>getUserListByRoleId(@Param("roleId")int roleId);

    public int add(TSysUser user);

    public int modify();
    public int updatePwd(@Param("id")Integer id , @Param("password")String pwd);

    public int deleteUserById(@Param("id")Integer id);

    /**
     * 第三章实例1
     */
    List<TSysUser>selectList(@Param("realName") String realName , @Param("roleId")Integer roleId);

    public List<TSysUser>getUserByRoleIdArray(Integer[] roleIds);

    /**
     * 第三章实例7
     * @param roleList
     * @return
     */
    public List<TSysUser>getUserByRoleIdList(List<Integer> roleList);

    /**
     * 第三章实例8
     * @param roleMap
     * @return
     */
    public List<TSysUser>getUserByRoleIdMap(Map<String , Object>roleMap);
}
